package com.binyouwei.designpatterns.behavior.command;

/**
 * @author 宾有为
 * Created on 2024/7/15 22:52
 * Social homepage: https://blog.csdn.net/baidu_41616022
 * @desc
 **/
public class LightOffCommand  implements Command {
    LightReceiver light;

    public LightOffCommand(LightReceiver light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.turnOff();
    }

    @Override
    public void undo() {
        light.turnOn();
    }
}